<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let a = 100; // 全局变量
      function f1() {
        let a = 20;
        console.log("内部修改前", a);
        a = 200;
        console.log("内部修改后", a);
      }
      function f2() {
        console.log(a);
      }

      f1();
      f2();

      console.log("外部", a); //
    </script>
  </body>
</html>
